package com.kensure.shike.lipin.service;

import com.kensure.shike.lipin.dao.SKLipinDao;
import com.kensure.shike.lipin.model.SKLipin;
import com.kensure.shike.lipin.service.SKLipinService;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import co.kensure.frame.JSBaseService;
import co.kensure.mem.MapUtils;


/**
 * 礼品信息服务实现类
 * @author fankd created on 2019-4-18
 * @since 
 */
@Service
public class SKLipinService extends JSBaseService{
	
	@Resource
	private SKLipinDao dao;
	@Resource
	private SKLipinTPService sKLipinTPService;
    
    
    public SKLipin selectOne(Long id){
    	return dao.selectOne(id);
    }
	
	public List<SKLipin> selectByIds(Collection<Long> ids){
		return dao.selectByIds(ids);
	}
	
	public List<SKLipin> selectLps(){
		Map<String, Object> parameters = MapUtils.genMap("status",0);
		List<SKLipin> lps = selectByWhere(parameters);
		for(SKLipin lp:lps){
			lp.setLptplist(sKLipinTPService.selectByLpid(lp.getId()));
		}
		return lps;
	}
	
	public List<SKLipin> selectByWhere(Map<String, Object> parameters){
		return dao.selectByWhere(parameters);
	}
	
	
	public long selectCount(){
		return dao.selectCount();
	}
	
	public long selectCountByWhere(Map<String, Object> parameters){
		return dao.selectCountByWhere(parameters);
	}
	
	
	public boolean insert(SKLipin obj){
		return dao.insert(obj);
	}
	
	public boolean insertInBatch(List<SKLipin> objs){
		return dao.insertInBatch(objs);
	}
	
	
	public boolean update(SKLipin obj){
		return dao.update(obj);
	}
    
    public boolean updateByMap(Map<String, Object> params){
		return dao.updateByMap(params);
	}
    
    
	public boolean delete(Long id){
		return dao.delete(id);
	}	
	
    public boolean deleteMulti(Collection<Long> ids){
		return dao.deleteMulti(ids);
	}
    
    public boolean deleteByWhere(Map<String, Object> parameters){
		return dao.deleteByWhere(parameters);
	}
    
    
  

}
